<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/2/25
 * Time: 10:34
 */

namespace common\sources\write\operatorlog;


use Yii;
class OperatorLogAccess implements IOperatorLogAccess
{
    public function addOperatorLog($data)
    {
        return Yii::$app->db->createCommand()->insert('operator_log', [
            'username' => $data['username'],
            'login_ip' => $data['login_ip'],
            'content' => $data['content'],
            'operator_phone' => $data['operator_phone'],
            'create_time' => time(),
            'index' => $data['index'],
            'sub_index' => $data['sub_index'],
        ])->execute();
    }

    public function setExportLog($data)
    {
        return Yii::$app->db->createCommand()->insert('operator_log', [
            'username' => $data['username'],
            'login_ip' => $data['login_ip'],
            'content' => $data['content'],
            'operator_phone' => $data['operator_phone'],
            'create_time' => time(),
            'index' => $data['index'],
            'sub_index' => $data['sub_index'],
            'export' => $data['export'],
            'export_time' => $data['export_time'],
        ])->execute();
    }
}